﻿// -----------------------------------------------------------------------
// <copyright file="Player.cs" company="Abyssalsoft">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Core.Player
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    /// <summary>
    /// Abstract player used for concrete implementation (audio / video)
    /// </summary>
    internal abstract class Player
    {
        #region Methods

        /// <summary>
        /// Open media file
        /// </summary>
        /// <param name="fileName">The file name to open</param>
        /// <param name="fileType">The type of the file</param>
        internal abstract void Open(string fileName, Helper.FileTypeEnum fileType);

        /// <summary>
        /// Play opened media file
        /// </summary>
        internal abstract void Play();

        /// <summary>
        /// Pause current playback
        /// </summary>
        internal abstract void Pause();

        /// <summary>
        /// Stop current playback
        /// </summary>
        internal abstract void Stop();

        /// <summary>
        /// Resume current playback
        /// </summary>
        internal abstract void Resume();

        /// <summary>
        /// Scroll file position to specific value
        /// </summary>
        /// <param name="value">The value where to jump</param>
        internal abstract void Seek(int value);

        /// <summary>
        /// Change playback volume
        /// </summary>
        /// <param name="value">Integer value representing the volume</param>
        internal abstract void SetVolume(int value);

        /// <summary>
        /// Dispose used objects
        /// </summary>
        internal abstract void Dispose();

        #endregion

        #region Properties

        /// <summary>
        /// Provides the total time in seconds of the current media file
        /// </summary>
        /// <returns>Returns the total time in seconds</returns>
        internal abstract double GetTotalTimeInSeconds();

        /// <summary>
        /// Provides the total time in bytes of the current media file
        /// </summary>
        /// <returns>Returns the total time in bytes</returns>
        internal abstract long GetTotalTimeInBytes();

        /// <summary>
        /// Provides the current position of the current media file
        /// </summary>
        /// <returns>Returns the current position in seconds</returns>
        internal abstract double GetCurrentPositionInSeconds();

        /// <summary>
        /// Provides the current position of the current media file
        /// </summary>
        /// <returns>Returns the current position in bytes</returns>
        internal abstract long GetCurrentPositionInBytes();

        /// <summary>
        /// Provides the total time of the current media file
        /// </summary>
        /// <returns>Returns a formatted string with the total file duration</returns>
        internal abstract string GetTotalTimeFormatted();

        /// <summary>
        /// Provides the current position of the current media file
        /// </summary>
        /// <returns>Returns a formatted string with the current position</returns>
        internal abstract string GetCurrentPositionFormatted();

        #endregion

        #region Specific video methods

        /// <summary>
        /// Switch to full screen
        /// </summary>
        internal abstract void SetVideoFullscreen();
        
        #endregion
    }
}
